import requests as rq

r = rq.get('https://www.baidu.com/')
print('content', r.content)
r.encoding = 'utf-8'
print('text', r.text)

from bs4 import BeautifulSoup

soup = BeautifulSoup('<p>Hello</p>', 'html.parser')
print(soup.p.string)
bs = BeautifulSoup('<p>Python</p>','lxml')
print(bs.p.string)